<template>
	<view>
		<view class="a">
			<view class="a1">用户名</view>
			<view class="a2">{{data2.username}}</view>
		</view>
		<view class="a">
			<view class="a1">昵称</view>
			<view class="a2">{{data2.nickname}}</view>
		</view>
		<view class="a">
			<view class="a1">手机号</view>
			<view class="a2">{{data2.tel}}</view>
		</view>
		
		<view class="button" @tap='goout'>退出</view>
	</view>
</template>

<script>
import {doLogout} from "../../../util/user/user.js"
  export default{
	  data(){
		  return{
			  data2:''
		  }
	  },
	  methods:{
		  goout(){
			  doLogout()
			  .then(res=>{
				  console.log(res)
			  })
			  uni.removeStorageSync('userInfo')
			  uni.switchTab({
			  	url:'../user'
			  })
		  }
	  },
	  onShow() {
	  	var data1=uni.getStorageSync('userInfo')
		console.log(data1)
		this.data2=data1
		console.log(this.data2)
	  }
	  
  }
</script>

<style>
	.a{
		width: 100%;
		height: 150rpx;
		display: flex;
        justify-content: space-between;
		border-bottom: 1px solid #E2E2E2;
	}
	.a1{
		width: 200rpx;
		text-align: center;
		line-height: 150rpx;
	}
	.a2{
		width: 250rpx;
		text-align: center;
		color: gray;
		line-height: 150rpx;
	}
	.button{
		width: 400rpx;
		height: 80rpx;
		margin: 60rpx auto;
		text-align: center;
		border-radius: 15rpx;
		background-color: #354E44;
		color: white;
		line-height: 80rpx;
	}
</style>
